package com.codeworker.asyncrequestresenddemo.service;

import com.codeworker.asyncrequestresenddemo.manager.AsyncManager;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.time.LocalTime;

/**
 * Description: 模拟本地方法(省略接口层)
 *
 * @author code-worker
 * @date 2021/10/14 20:10
 */
@Service("LocalService")
public class LocalService {

    @Resource
    private AsyncManager asyncManager;

    /**
     * task: 调用异步方法
     * @param num 数字
     * @author code-worker
     * @date 2021/10/14 20:14
     */
    public void askAsyncManager(int num){
        System.out.println("LocalService | askAsyncManager | thread: " + Thread.currentThread().getName() + ", time: " + LocalTime.now());
        asyncManager.method01(num);
    }
}
